<?php
class Ext_Paginator extends Zend_Paginator 
{
    /**
     * Constructor.
     */
    public function __construct( $adapter, $page = 1 ) 
    {
    	Zend_Paginator::setDefaultScrollingStyle( 'all' );
        Zend_View_Helper_PaginationControl::setDefaultViewPartial( 'paginator/search_paginator_control.phtml' );
    	
        if ( $adapter instanceof Zend_Db_Select ) {
			parent::__construct( new Zend_Paginator_Adapter_DbSelect( $adapter ) );
        } elseif ( $adapter instanceof Zend_Db_Table_Rowset ) {
            parent::__construct( new Zend_Paginator_Adapter_Iterator( $adapter ) );
        } else {
       		parent::__construct( $adapter );
        }
        $this->setItemCountPerPage( 30 );
       	$this->setCurrentPageNumber( $page	);
	}
}